package com.example.springboot.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 评价表
 * </p>
 *
 * @author
 *
 */
@Getter
@Setter
@ApiModel(value = "Reviews对象", description = "评价表")
public class Reviews implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("预订ID")
    private Integer bookingId;

    @ApiModelProperty("用户ID")
    private Integer userId;

    @ApiModelProperty("民宿ID")
    private Integer homestayId;

    @ApiModelProperty("评价内容")
    private String content;

    @ApiModelProperty("评分（1-5）")
    private Integer rating;

    @ApiModelProperty("回复内容")
    private String reply;

    @JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime replyTime;

    @ApiModelProperty("状态：0-隐藏，1-显示")
    private Integer status;

    @JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime time;

    @JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;
    // 用户信息（非数据库字段）
    @TableField(exist = false)
    private String username;

    @TableField(exist = false)
    private String nickname;

    @TableField(exist = false)
    private String avatar;

}
